import Cookies from 'js-cookie'

const state = {
  activeMenu: {},
  menuList: [],
  sortMenuList: []
}

const mutations = {
  ACTIVE_MENU: (state, value) => {
    state.activeMenu = value
  },
  MENU_LIST: (state, value) => {
    state.menuList = value
  },
  SORT_MENU_LIST: (state, value) => {
    state.sortMenuList = value
  }
}

const actions = {
  toggleMenu({ commit }, value) {
    commit('ACTIVE_MENU', value)
  },
  sidebarMenu({ commit }, value) {
    commit('MENU_LIST', value)
  },
  dropMenu({ commit }, value) {
    commit('SORT_MENU_LIST', value)
  }

}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
